package com.cyou.qb.face.service;

import org.dom4j.DocumentException;

import com.cyou.qb.face.entity.ActivityInfo;
import com.cyou.qb.face.entity.trans.ActReturn;
import com.cyou.qb.face.exception.QbGetDataException;

/**
 * 商城GB信息操作接口
 * @author wangwenlong
 *
 */

public interface QbOperateService extends BaseFaceService{

	enum  MinusGbResult{
		SUCCESS,NOTRNOUGH,FAIL
	}
	/**
	 * 向商城申请创建活动
	 * @param passport
	 * @param password
	 * @param gbvalue
	 * @return 生成活动的ID
	 * @throws DocumentException 
	 */
	public ActReturn applyGb(String passport,String password,int gbvalue,ActivityInfo info) throws QbGetDataException, DocumentException;
	
	/**
	 * 为已经开始的活动追加奖品
	 * @param id
	 * @param gbvalue
	 * @return
	 * @throws DocumentException 
	 */
	public int appendGb(String passport,String password,int activeid,int gbvalue,String memo) throws QbGetDataException, DocumentException;
	
	/**
	 * 获取登录玩家的GB值
	 * @param id
	 * @return 返回GB数值若小于0则为查询失败
	 */
	public int getUserGb(String passport);
	
	/**
	 * 为玩家增加GB信息
	 * @param gbvalue
	 * @return 增加是否成功
	 * @throws QbGetDataException 
	 */
	public boolean plusGb(String passport,int activeid,int gbvalue,String memo) throws QbGetDataException;
	
	/**
	 * 为玩家减GB信息
	 * @param gbvalue
	 * @return 增加是否成功
	 * @throws QbGetDataException 
	 */
	public MinusGbResult minusGb(String passport, int gbvalue, String memo, int channelId) throws QbGetDataException;
	
}
